<%@page import="model.AccountImp"%>
<%@page import="java.util.List"%>
<%@page import="model.entity.Account"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="<c:url value="/views/admin/js/jquery-1.8.2.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/views/admin/js/tabifier.js"/>"></script>
<script type="text/javascript" src="<c:url value="/views/admin/js/js.js"/>"></script>
<script type="text/javascript" src="<c:url value="/views/admin/js/jPages.js"/>"></script>
<script type="text/javascript" src="<c:url value="/views/admin/js/highlight.pack.js"/>"></script>
<script type="text/javascript" src="<c:url value="/views/admin/js/jquery_ui_1.8.5.min.js"/>"></script>

<script type="text/javascript">
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

  </script>
  <script>
      function ConfirmDelete()
{
  var x = confirm("Are you sure you want to delete?");
  if (x)
      return true;
  else
    return false;
}
  </script>
   <script>
  $(function(){
    $("div.holder").jPages({
      containerID : "movies",
      previous : "Pre",
      next : "Next",
      perPage : 10,
      delay : 20
    });
    
    
  });
  </script>

  <style type="text/css">
  table{ width: 960px; margin-top: 30px; }
  td, th{ text-align: left; height:25px; }
  th { background: #f5f5f5; }
  th:nth-child(1){ width:10%; }
  th:nth-child(2){ width:10%; }
  th:nth-child(3){ width:10%; }
  th:nth-child(4){ width:20%;}
  th:nth-child(5){ width:30%;}
  th:nth-child(6){ width:10%;}
  th:nth-child(7){ width:10%;}

  form { float: left; margin-right: 10px; }
  form label { margin-right: 5px; }
  form select { margin-right: 75px; }
  </style>
 <link href="<c:url value="/views/admin/css/jPages.css"/>" rel="stylesheet" type="text/css" />
  <link href="<c:url value="/views/admin/css/animate.css"/>" rel="stylesheet" type="text/css" />
   <link href="<c:url value="/views/admin/css/style.css"/>" rel="stylesheet" type="text/css" />
    <link href="<c:url value="/views/admin/css/github.css"/>" rel="stylesheet" type="text/css" />



<h2>Account</h2>
            

            
            <p class="message1">
                <%if(request.getAttribute("messagecreate")!=null)
                       {
%>
<div class="notification success canhide">
            
                <p><strong>SUCCESS: </strong>
                Created account</p>
            </div>
                 </p>
                 <%}%>
            <p class="message1">
<%
                            String message1 = request.getAttribute("messageedit")==null ? "":request.getAttribute("messageedit").toString();
                        out.println(message1);
%>
<%
    if(request.getAttribute("message1") != null)
               {
%>

<div class="notification success canhide">
            
                <p><strong>SUCCESS: </strong>
                Delete account</p>
            </div>
            <%}%>

                 <p class="message2">
<%
                            String message3 = request.getAttribute("credit")==null ? "":request.getAttribute("credit").toString();
                        out.println(message3);
%>
                 </p>
                 <br/>
                 <form name="formsearch" method="POST" action="<c:url value="/admin/searchuser"></c:url>">
                    <label for="tags">Name: </label>
                    <input type="text" name="searchuser"/>
                    <input type="submit" class="submit" value="Search"/>
                 </form>        
    <div class="clearfix">&nbsp;</div>
	
    <table width="960px" class="" border="0" cellpadding="0" cellspacing="0">
    <thead>
        <tr>
            <th width="10%" scope="col">Username</th>
            <th width="10%%" scope="col">Password</th>
            <th width="10%" scope="col">Card number</th>
            <th width="20%" scope="col">Name</th>
            <th width="30%" scope="col">Credit</th>
            <th width="10%" scope="col">Phone</th>
          
            <th width="10%" scope="col">Option</th>
        </tr>
    </thead>
        <tbody id="movies">
            
<%
                
    List<Account> listacc = (List<Account>) request.getAttribute("listacc");
    for(Account list1 : listacc)
    {
%>
        <tr>
        
            
            <td scope="col"><%= list1.getUsername() %></td>
            <td scope="col"><%= list1.getPassword() %></td>
            <td scope="col"><%= list1.getCardnumber() %></td>
            <td scope="col"><%= list1.getFirstname() %> <%= list1.getLastname() %></td>
            <td scope="col"><%= list1.getCredit() %></td>
            <td scope="col"><%= list1.getHomephone() %></td>
           
            <td scope="col">
                <form name="form" action="<c:url value="admin/account/delete"/>" method="POST">
                    <a onclick="return ConfirmDelete();" href="<c:url value="<%= "/admin/account/delete/" + list1.getUsername() %>">
                       
                   </c:url>"><img src="<c:url value="/views/admin/images/icondock/page_white_delete.png"/>" title="Delete"/></a> 
                   <a href="<c:url value="<%= "/admin/account/edit/" + list1.getUsername() %>">        
                      
                      </c:url>"/><img title="Edit" src="<c:url value="/views/admin/images/icondock/page_white_edit.png"/>"/></a>
                      <a href="<c:url value="<%= "/admin/account/credit/" + list1.getUsername() %>">        
                      
                      </c:url>"/><img title="Credit" src="<c:url value="/views/admin/images/cart.png"/>"/></a>
                </form> 
                  
            </td>
            
        </tr>
<%}%>      
    </tbody></table>
  
             
<div class="holder"></div>  

    <!-- END TABULAR DATA EXAMPLE -->

 
<div class="clearfix">&nbsp;</div>
